package com.fjh.springboot_01.service;

import com.fjh.springboot_01.pojo.homework.Homework;
import com.fjh.springboot_01.pojo.homework.HomeworkQuestion;
import com.fjh.springboot_01.pojo.homework.HomeworkAnswer;
import java.util.List;

public interface HomeworkService {
    // 作业管理
    void createHomework(Homework homework, List<HomeworkQuestion> questions);
    Homework getHomeworkById(Integer id);
    List<Homework> getTeacherHomeworks(Integer teacherId);
    List<Homework> getStudentHomeworks(Integer studentId);
    void updateHomeworkStatus(Integer id, Integer status);
    
    // 作业题目管理
    void addQuestion(HomeworkQuestion question);
    void updateQuestion(HomeworkQuestion question);
    void deleteQuestion(Integer questionId);
    List<HomeworkQuestion> getQuestionsByHomeworkId(Integer homeworkId);
    
    // 学生答案管理
    void submitAnswer(HomeworkAnswer answer);
    void updateAnswer(Integer answerId, String answerContent);
    List<HomeworkAnswer> getAnswersByHomeworkAndStudent(Integer homeworkId, Integer studentId);
    
    // 教师批改
    void gradeAnswer(Integer answerId, String teacherComment, Integer score);
    
    // 自动批改
    void autoGradeAnswer(Integer answerId);
    void autoGradeHomework(Integer homeworkId, Integer studentId);
    double calculateAnswerSimilarity(String studentAnswer, String standardAnswer);
    
    // AI出题相关
    List<HomeworkQuestion> generateQuestionsByAI(Integer categoryId, Integer knowledgePointId, 
                                               Integer questionType, Integer questionCount,
                                               String topic);
    String generateQuestionContent(String topic, Integer questionType);
    String generateStandardAnswer(String questionContent, Integer questionType);
    List<String> generateOptions(String questionContent, String standardAnswer);
} 